package controllers;


import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.RenderRequest;  
import javax.portlet.RenderResponse;  
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;  
import org.springframework.ui.Model;  
import org.springframework.web.bind.annotation.RequestMapping;  
import org.springframework.web.portlet.bind.annotation.ActionMapping;
import org.springframework.web.portlet.bind.annotation.RenderMapping;  

import com.liferay.portal.kernel.util.ParamUtil;
  
@Controller(value = "MyFirstSpringMVCTestController")  
@RequestMapping("VIEW")  
public class MyFirstSpringMVCTestController {  
	private static final Logger logger = Logger.getLogger(MyFirstSpringMVCTestController.class);
	
    @RenderMapping  
    public String handleRenderRequest(RenderRequest request,RenderResponse response,Model model){  
       
     return "defaultRender";  
    }  
    
    @ActionMapping(params = "action=actionOne")   
    public void actionOneMethod(ActionRequest request, ActionResponse response, Model model) { 
    	String userName=ParamUtil.get(request, "userName", "");  
    	response.addProperty("userName",userName);
    	logger.info("userName is==>"+userName);  
    }  
  
}  